﻿using System;
using System.Security.Permissions;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Security;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint.Workflow;

namespace LifeInSharePoint.PromotedLinks.Common.Receiver.PromotedLinksAdded
{
    /// <summary>
    /// List Events
    /// </summary>
    public class PromotedLinksAdded : SPListEventReceiver
    {
       /// <summary>
       /// A list was added.
       /// </summary>
       public override void ListAdded(SPListEventProperties properties)
       {
           base.ListAdded(properties);

           SPWeb currentWeb = properties.Web;
           SPList thisList = currentWeb.Lists[properties.ListId];
           SPField orderField = thisList.Fields["Order"];
           orderField.SchemaXml = orderField.SchemaXml.Replace("Hidden='TRUE'", "Hidden='FALSE'");

       }


    }
}
